﻿#region Using namespaces

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;

using AvalonDock;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.Converters
{
    public class DockableContentStateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            DockableContentState state = (DockableContentState)value;
            string p = parameter.ToString();

            if (p == "AutoHide")
                return state == DockableContentState.AutoHide;
            else if (p == "DockableWindow")
                return state != DockableContentState.DockableWindow;
            else if (p == "Dock")
                return state == DockableContentState.Docked;
            else if (p == "Document")
                return state != DockableContentState.Document;
            else if (p == "Float")
                return state != DockableContentState.FloatingWindow;
            else if (p == "Hide")
                return state == DockableContentState.Hidden;
            else
                return state == DockableContentState.None;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    } 
}
